var express = require('express')
var router = express.Router();
var querystring = require('querystring')
router.get('/tag/list.html',function(req,res,next){
    res.jsonp({
  "resultCode": 0, 
  "resultMsg":"XXX", 
  "result": [
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味厨房"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 2,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "约吧1"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味厨房2"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 2,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "约吧3"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味4"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 2,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "约吧5"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味6"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 2,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "约吧7"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味厨房8"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 2,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "约吧9"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味10"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 2,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "约吧11"
    },{
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味12"
    },
    {
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 2,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "约吧13"
    },{
        "tagIcon": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagId": 1,
        "tagImage": "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
        "tagName": "美味厨房14"
    },
 
    ]})
})

router.get('/post/query/common.html',function(req,res,next){
    res.jsonp({
  "resultCode": 0, //0为成功
  "resultMsg":"XXX", //错误信息
  "result": [
    {
        "commentCount": 1, //评论数量
        "commentList": [
            {
                "comment": "好棒哦",
                "custName": "用户1",
                "custNo": "123456"
            }
        ],
        "custName": "蜡笔小新0",
        "custNo": "123456789",
        "images": [
            "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
            "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
        ],
        "postTitle": "今天的天气真好0",
        "postType": 1,// 帖子类型0：普通帖子（用户与管理员皆可发布）  1：公告  2：投票  3：报名活动
        "praiseCount": 1, //点赞数
        "praiseList": [
            {
                "custName": "用户1",
                "custNo": "123456"
            },
            {
                "custName": "用户2",
                "custNo": "123456"
            }
        ],
        "publishTime": "2016-10-18 17:18:03" //发布时间
    },
    {
        "commentCount": 1,
        "commentList": [
            {
                "comment": "好棒哦",
                "custName": "用户1",
                "custNo": "123456"
            },
             {
                "comment": "好棒哦1111",
                "custName": "用户1",
                "custNo": "123456"
            }
        ],
        "custName": "蜡笔小新1",
        "custNo": "123456789",
        "images": [
            "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
            "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
        ],
        "postTitle": "今天的天气真好1",
        "postType": 0,
        "praiseCount": 1,
        "praiseList": [
            {
                "custName": "用户3",
                "custNo": "123456"
            },
            {
                "custName": "用户4",
                "custNo": "123456"
            }
        ],
        "publishTime": "2016-10-18 17:18:04"
    },
    {
        "commentCount": 1,
        "commentList": [
            {
                "comment": "好棒哦",
                "custName": "用户1",
                "custNo": "123456"
            },
             {
                "comment": "好棒哦1111",
                "custName": "用户1",
                "custNo": "123456"
            }
        ],
        "custName": "蜡笔小新1",
        "custNo": "123456789",
        "images": [
            "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
            "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
        ],
        "postTitle": "今天的天气真好1",
        "postType": 0,
        "praiseCount": 1,
        "praiseList": [
            {
                "custName": "用户3",
                "custNo": "123456"
            },
            {
                "custName": "用户4",
                "custNo": "123456"
            }
        ],
        "publishTime": "2016-10-18 17:18:04"
    }
]
    })
})

//普通帖子详情
router.get('/post/query/info.html',function(req,res,next){
    var querys = req.url.split('?')[1];
    var querys = querystring.parse(querys);
    switch(querys.postType){
        case '0':
            res.jsonp({
            "resultCode": 0, 
            "resultMsg":"XXX", 
            "result": {
                "custName": "蜡笔小新",
                "custNo": "123456",
                "images": [
                    "/temp/2.png",
                    "/temp/2.png"
                ],
                "postTitle": "科学的早餐应该是地热能",
                "postContent": "公告内容公告内容公告内容公告内容公告内容公告内容公告内容",
                "postType": 0
            }})
            break;
        case '1':
            res.jsonp({
                "custName": "蜡笔小新",
                "custNo": "123456",
                "images": [
                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
                ],
                "postContent": "公告内容公告内容公告内容公告内容公告内容公告内容公告内容",
                "postTitle": "公告标题",
                "postType": 1
            });
            break;
        case '2':
            var result = {
                "attendFlag": 0,  //0：未参加  1：已参加
                "custName": "蜡笔小新1",
                "custNo": "123456",
                "publishTime":"2014-11-11 12:34:56",
                "images": [
                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
                ],
                "postContent": "投票内容描述",
                "postTitle": "投票标题",
                "postType": 2,
                "voteItemList": [
                    {
                        "itemContent": "投票项内容",
                        "itemId": 23333,
                        "optionList": [
                            {
                                "images": [
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"   
                                ],
                                "optionId": 2,
                                "optionName": "投票项选项一1",
                                "voteUserCount": "10"
                            },
                            {
                                "images": [
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
                                ],
            "optionId": 6,
                                "optionName": "投票项选项一2",
                                "voteUserCount": "20"
                            },
                            {
                                "images": [
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
                                ],
                                "optionId": 3,
                                "optionName": "投票项选项一3",
                                "voteUserCount": "30"
                            },
                            {
                                "images": [
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                                    "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
                                ],
                                "optionId": 4,
                                "optionName": "投票项选项一4",
                                "voteUserCount": "40"
                            }
                        ]
                    }
                ]
            };
            res.jsonp({
                "resultCode": 0, //0为成功
                "resultMsg":"XXX", //错误信息
                "result": result

            });
            break;
            case '3':
                res.jsonp({
                    "attendFlag": 0, ////0：未参加  1：已参加
                    "custName": "蜡笔小新",
                    "custNo": "123456",
                    "images": [
                        "http://image2.suning.cn/uimg/cms/img/147041421405125628.png",
                        "http://image2.suning.cn/uimg/cms/img/147041421405125628.png"
                    ],
                    "postContent": "报名内容描述",
                    "postReportVo": {
                        "address": "苏宁大道一号",
                        "endTime": "2016-10-09 00:00:00",
                        "startTime": "2016-10-05 00:00:00"
                    },
                    "postTitle": "报名标题",
                    "postType": 3
                });
            default:
                console.log('fuck');
    }
})
router.get('/post/save/vote.do',function(req,res){
    res.jsonp({
        "resultCode": 0, //0为成功
        "resultMsg":"XXX" //错误信息

    })
})
//获取评论列表
router.get('/post/query/commentsMore.json',function(req,res,next){
    res.jsonp({
        "resultCode": 0, //0为成功
        "resultMsg":"XXX", //错误信息
        "result": {
            "cuList": [
                {
                    "comment": "好棒哦好棒哦好棒哦",   //评论内容
                    "custName": "用户2",  //用户名
                    "custNo": "123456"    //用户会员编号
                },
                {
                    "comment": "好棒哦",   //评论内容
                    "custName": "用户1",  //用户名
                    "custNo": "123456"    //用户会员编号
                }
            ],
            "pageNum": 1,      //当前页码
            "totalPageCount": 2 //总页数
        }
    })
})
//增加评论
router.get('/post/save/comment.do',function(req,res,next){
    res.jsonp({
      "resultCode": 0, //0为成功
      "resultMsg":"XXX" //错误信息
    })
})
//增加评论
router.get('/post/delete.do',function(req,res,next){
    res.jsonp({
      "resultCode": 0, //0为成功
      "resultMsg":"XXX" //错误信息
    })
})
//举报
router.get('/post/report.do',function(req,res,next){
    res.jsonp({
      "resultCode": 0, //0为成功
      "resultMsg":"XXX" //错误信息
    })
})
//获取帖子点赞评论
router.get('/post/query/commPraise',function(req,res,next){
    res.jsonp({
        "resultCode": 0, //0为成功
        "resultMsg":"XXX", //错误信息
        "result": [
            {
                "commentVo": {
                    "commentCount": 2, //评论数
                    "cuList": [
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户2",//用户名
                            "custNo": "123456"   //用户会员编号
                        },
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户1",//用户名
                            "custNo": "123456"   //用户会员编号
                        },
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户3",//用户名
                            "custNo": "123456"   //用户会员编号
                        },
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户4",//用户名
                            "custNo": "123456"   //用户会员编号
                        },
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户2",//用户名
                            "custNo": "123456"   //用户会员编号
                        },
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户1",//用户名
                            "custNo": "123456"   //用户会员编号
                        },
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户3",//用户名
                            "custNo": "123456"   //用户会员编号
                        },
                        {
                            "comment": "好棒哦", //评论内容
                            "custName": "用户4",//用户名
                            "custNo": "123456"   //用户会员编号
                        }
                    ],//评论列表
                    "pageNum": 1, //评论当前页码
                    "totalPageCount": 5  //评论总页数
                },
                "praiseVo": {
                    "praiseCount": 2,  //点赞数
                    "puList": [
                        {
                            "custName": "用户1",//用户名
                            "custNo": "123456"  //用户会员编号
                        },
                        {
                            "custName": "用户2",//用户名
                            "custNo": "123456"  //用户会员编号
                        }
                    ]   //点赞列表
                }
            }
        ]

    })
})
//点赞
router.get('/post/save/praise.do',function(req,res,next){
    res.jsonp({
      "resultCode": 0, //0为成功
      "resultMsg":"XXX" //错误信息
    })
})
//获取报名帖子详情
router.get('/post/query/info.html1',function(req,res,next){
    res.jsonp({
        "resultCode": 0, //0为成功
        "resultMsg":"XXX", //错误信息
        "result":{
            "attendFlag": 0, ////0：未参加  1：已参加
            "custName": "蜡笔小新",
            "custNo": "123456",
            "images": [
                "/temp/2.png",
                "/temp/2.png"
            ],
            "postContent": "报名内容描述",
            "postReportVo": {
                "address": "苏宁大道一号",
                "endTime": "2016-10-30 00:00:00",
                "startTime": "2016-10-28 00:00:00"
            },
            "postTitle": "报名标题",
            "postType": 3
        }
    })
})
//获取报名信息填写
router.get('/post/query/signInfo.html',function(req,res,next){
    res.jsonp({
        "resultCode": 0, //0为成功
        "resultMsg":"XXX", //错误信息
        "result":[
        {
            "formId": 1, //表单项id
            "itemIdentify": "sex", //标识 （input name属性）
            "itemName": "性别", //表单项名称
            "itemOptionValue": "男,女", //表单项可选值  itemType=1时有效
            "itemTip": "请选择性别", //表单项提示信息 （placeholder）
            "itemType": 1, //表单项类型0：文本框 1：单选
            "listOrder": 1 //排序号
        },
        {
            "formId": 0,
            "itemIdentify": "name",
            "itemName": "姓名",
            "itemTip": "请填写姓名",
            "itemType": 0,
            "listOrder": 0
        }
        ]
    })
})
//获取报名信息填写
router.get('/post/save/sign.do',function(req,res,next){
    res.jsonp({
        "resultCode": 0, //0为成功
        "resultMsg":"XXX" //错误信息
    })
})
//报名帖子发布
router.get('/post/publish/sign.do',function(req,res,next){
    res.jsonp({
        "resultCode": 0, //0为成功
        "resultMsg":"XXX" //错误信息
    })
})
module.exports = router